/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sirtet.tetris.gui;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JTextField;
import sirtet.Player;
import sirtet.tetris.TetrisBoard;

/**
 * (For testing purpose only) a window monitor which visualizes the status of a TetrisBoard
 * @author guangwei.zhu
 */
public class TetrisFrame extends JFrame {

    public TetrisFrame(TetrisBoard board, Player player) {
        this(board);

        this.setTitle("Server Monitor - " + player.id());
    }

    public TetrisFrame(TetrisBoard board) {
        JTextField memo = new JTextField();
        memo.setSize(100, 16);
        this.setLayout(new BorderLayout());

        this.add(new TetrisBoardPanel(board), BorderLayout.CENTER);
        this.add(memo, BorderLayout.NORTH);
        this.setSize(440, 620);

        this.setTitle("Server Monitor");
    }
}
